package com.tensai.study.新概念.响应式编程.reactor.flux;

import org.junit.Test;
import reactor.core.publisher.Flux;

/**
 * @author Tensai
 */
public class TakeTest {

    @Test
    public void test() {
        Flux.range(1, 20).take(10).subscribe(System.out::println);
        System.out.println("----------------------------------------");
        Flux.range(1, 20).takeLast(10).subscribe(System.out::println);
        System.out.println("----------------------------------------");
        Flux.range(1, 20).takeWhile(i -> i < 10).subscribe(System.out::println);
        System.out.println("----------------------------------------");
        Flux.range(1, 20).takeUntil(i -> i == 10).subscribe(System.out::println);

    }
}
